package com.liming.stock.client;

import com.liming.common.pojo.dto.stock.warehouse.WarehouseAddDTO;
import com.liming.common.pojo.dto.stock.warehouse.WarehousePageQuery;
import com.liming.common.pojo.dto.stock.warehouse.WarehouseUpdateDTO;
import com.liming.common.pojo.vo.PageVO;
import com.liming.common.pojo.vo.stock.warehouse.WarehouseVO;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.cloud.openfeign.SpringQueryMap;
import org.springframework.web.bind.annotation.*;

/**
 * @author liming
 * @date 2025/3/1
 */
@FeignClient(value = "stock-service",contextId = "warehouseClient", path = "/service/warehouse")
public interface WarehouseClient {


    /**
     * 获取分页信息
     *
     * @param query 查询条件
     * @return 分页信息
     */
    @GetMapping
    PageVO<WarehouseVO> page(@SpringQueryMap WarehousePageQuery query);

    /**
     * 新增仓库信息
     *
     * @param warehouseAddDTO 新增仓库信息
     * @return 是否新增成功
     */
    @PostMapping
    Boolean add(@RequestBody WarehouseAddDTO warehouseAddDTO);

    /**
     * 更新仓库信息
     *
     * @param warehouseUpdDTO 更新仓库信息
     * @return 是否更新成功
     */
    @PutMapping
    Boolean update(@RequestBody WarehouseUpdateDTO warehouseUpdDTO);

    /**
     * 删除仓库信息
     *
     * @param id 仓库ID
     * @return 是否删除成功
     */
    @DeleteMapping("{id}")
    Boolean delete(@PathVariable Long id);
}
